<?php
/**
 * Created By Project
 * Author: 陈东
 * Copyright：陈东
 * Source Code：陈东
 * Explain：I shall not authorize for any other commercial purposes, law breakers must be prosecuted.
 */
namespace Home\Widget;
use Think\Controller;
class BottomWidget extends Controller {

	//针对第六套简版，输出底部菜单栏
	function getbottommenu($rootid=null){
		$submenu = D(C('TABLE_SUBMENU'));
		$res = $submenu->field('id,mtitle,malias,position,jumpaddres')->where(array('mtypeid'=>$rootid,'position'=>2))->order('msort asc')->select();
		return $res;
	}

	//根据文章ID获取rootid
	function getrootidanddomainid($rootid,$domainid,$articleid=null){
		$article = D(C('TABLE_SUBMENU'));
		$res = $article->find($articleid);
		if($res){
			$typeid = $res['mtypeid'];
			if($rootid=='rootid'){
				return $typeid;
			}else if($domainid=='domainid'){
				return $this->getdomanid($typeid);
			}
		}
	}

	//根据rootid获取domainid
	function getdomanid($rootid=null){
		$type = D(C('TABLE_TYPE'));
		$res = $type->field('domainid')->find($rootid);
		if($res){
			return $res['domainid'];
		}
	}


}
?>